<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema
   targetNamespace="http://www.opengis.net/wfs-kvp"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:wfs-kvp="http://www.opengis.net/wfs-kvp"
   elementFormDefault="qualified"
   version="1.1.0">
   <xsd:annotation>
      <xsd:documentation>
         This file defines the abstract schema of keyword-value pair
         encoding of WFS operations.  This is NOT the wire format.  
         The types in this file are meant to convery the structure.
      </xsd:documentation>
   </xsd:annotation>
   <xsd:simpleType name="CommaSeparatedList">
      <xsd:restriction base="xsd:string">
         <xsd:pattern
            value="\w(,\w)* |
                  '(' \w(,\w)* ')' |
                  '(' '(' \w(,\w)* ')' (,'(' \w(,\w)* ')')* ')' "/>
      </xsd:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="BBoxType">
      <xsd:restriction base="xsd:string">
         <xsd:pattern value="(\d,\d)(,\d,\d)*"/>
      </xsd:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="All_N_ValueType">
      <xsd:restriction base="xsd:string">
         <xsd:pattern value="ALL | \d"/>
      </xsd:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="All_Some_ValueType">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="ALL"/>
         <xsd:enumeration value="SOME"/>
      </xsd:restriction>
   </xsd:simpleType>
   <!-- GETCAPABILITIES TYPE DEFINITION ================================= -->
   <xsd:complexType name="GetCapabilitiesType">
      <xsd:sequence>
         <xsd:element name="service" type="xsd:string" 
                      minOccurs="1" maxOccurs="1" fixed="WFS"/>
         <xsd:element name="version" type="xsd:string" minOccurs="0"/>
         <xsd:element name="namespace" type="xsd:string" minOccurs="0"/>
         <xsd:element name="request">
            <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                  <xsd:enumeration value="GetCapabilities"/>
               </xsd:restriction>
            </xsd:simpleType>
         </xsd:element>
      </xsd:sequence>
   </xsd:complexType>
   <!-- DESCRIBEFEATURETYPE TYPE DEFINITION ============================== -->
   <xsd:complexType name="DescribeFeatureTypeRequestType">
      <xsd:sequence>
         <xsd:element name="service" type="xsd:string" 
                      minOccurs="1" maxOccurs="1" fixed="WFS"/>
         <xsd:element name="version" type="xsd:string" minOccurs="0"/>
         <xsd:element name="namespace" type="xsd:string" minOccurs="0"/>
         <xsd:element name="request">
            <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                  <xsd:enumeration value="DescribeFeatureType"/>
               </xsd:restriction>
            </xsd:simpleType>
         </xsd:element>
         <xsd:element name="typeName" type="wfs-kvp:CommaSeparatedList"
                      minOccurs="0"/>
         <xsd:element name="outputFormat" type="xsd:string"
                      minOccurs="0" default="text/xml; subtype=gml/3.1.1"/>
      </xsd:sequence>
   </xsd:complexType>
   <!-- GETFEATURE/GETFEATUREWITHLOCK TYPE DEFINITION ===================== -->
   <xsd:complexType name="GetFeatureRequestType">
      <xsd:annotation>
         <xsd:documentation>
            JL: avoids Unique Particle Attribution constraint violation.
         </xsd:documentation>
      </xsd:annotation>
      <xsd:sequence>
         <xsd:element name="service" type="xsd:string" 
                      minOccurs="1" maxOccurs="1" fixed="WFS"/>
         <xsd:element name="version" type="xsd:string" minOccurs="0"/>
         <xsd:element name="namespace" type="xsd:string" minOccurs="0"/>
         <xsd:element name="request">
            <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                  <xsd:enumeration value="GetFeature"/>
                  <xsd:enumeration value="GetFeatureWithLock"/>
               </xsd:restriction>
            </xsd:simpleType>
         </xsd:element>
         <xsd:element name="outputFormat" type="xsd:string"
                      minOccurs="0" default="text/xml; subtype=gml/3.1.1"/>
         <xsd:element name="resulttype" minOccurs="0" default="results">
            <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                  <xsd:enumeration value="results"/>
                  <xsd:enumeration value="hits"/>
               </xsd:restriction>
            </xsd:simpleType>
         </xsd:element>
         <xsd:element name="propertyname" type="wfs-kvp:CommaSeparatedList"
                      minOccurs="0"/>
         <xsd:element name="featureversion" type="wfs-kvp:All_N_ValueType"
                      minOccurs="0"/>
         <xsd:element name="maxfeatures" type="xsd:positiveInteger"
                      minOccurs="0"/>
         <xsd:element name="expiry" type="xsd:positiveInteger"
                      minOccurs="0"/>
         <xsd:element name="srsname" type="xsd:string"
                      minOccurs="0"/>
         <xsd:choice>
            <xsd:element name="featureid" type="wfs-kvp:CommaSeparatedList"/>
            <xsd:sequence>
               <xsd:element name="typename" type="wfs-kvp:CommaSeparatedList"/>
               <xsd:choice>
                  <xsd:element name="filter" type="xsd:string"/>
                  <xsd:element name="bbox" type="wfs-kvp:BBoxType"/>
               </xsd:choice>
            </xsd:sequence>
         </xsd:choice>
         <xsd:element name="sortby" type="xsd:string"
                      minOccurs="0"/>
         <xsd:element name="traversexlinkdepth" type="xsd:positiveInteger"
                      minOccurs="0"/>
         <xsd:element name="traversexlinkexpiry" type="xsd:positiveInteger"
                      minOccurs="0"/>
         <xsd:element name="porptravxlinkdepth" type="xsd:positiveInteger"
                      minOccurs="0"/>
         <xsd:element name="porptravxlinkexpiry" type="xsd:positiveInteger"
                      minOccurs="0"/>
      </xsd:sequence>
   </xsd:complexType>
   <!-- GETGMLOBJECT TYPE DEFINITION ===================================== -->
   <xsd:complexType name="GetGMLObjectRequestType">
      <xsd:sequence>
         <xsd:element name="service" type="xsd:string" 
                      minOccurs="1" maxOccurs="1" fixed="WFS"/>
         <xsd:element name="version" type="xsd:string" minOccurs="0"/>
         <xsd:element name="namespace" type="xsd:string" minOccurs="0"/>
         <xsd:element name="request">
            <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                  <xsd:enumeration value="GetGMLObject"/>
               </xsd:restriction>
            </xsd:simpleType>
         </xsd:element>
         <xsd:element name="outputFormat" type="xsd:string"
                      minOccurs="0" default="text/xml; subtype=gml/3.1.1"/>
         <xsd:element name="traversexlinkdepth" type="xsd:positiveInteger"
                      minOccurs="0"/>
         <xsd:element name="traversexlinkexpiry" type="xsd:positiveInteger"
                      minOccurs="0"/>
         <xsd:element name="gmlobjectid" type="wfs-kvp:CommaSeparatedList"/>
      </xsd:sequence>
   </xsd:complexType>
   <!-- LOCKFEATURERE TYPE DEFINITION ===================================== -->
   <xsd:complexType name="LockFeatureRequestType">
      <xsd:annotation>
         <xsd:documentation>
            JL: avoids Unique Particle Attribution constraint violation.
         </xsd:documentation>
      </xsd:annotation>
      <xsd:sequence>
         <xsd:element name="service" type="xsd:string" 
                      minOccurs="1" maxOccurs="1" fixed="WFS"/>
         <xsd:element name="version" type="xsd:string" minOccurs="0"/>
         <xsd:element name="namespace" type="xsd:string" minOccurs="0"/>
         <xsd:element name="request">
            <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                  <xsd:enumeration value="LockFeature"/>
               </xsd:restriction>
            </xsd:simpleType>
         </xsd:element>
         <xsd:element name="expiry" type="xsd:positiveInteger" minOccurs="0"/>
         <xsd:element name="lockaction" type="wfs-kvp:All_Some_ValueType"
                      minOccurs="0"/>
         <xsd:choice>
            <xsd:element name="featureid" type="wfs-kvp:CommaSeparatedList"/>
            <xsd:sequence>
               <xsd:element name="typename" type="wfs-kvp:CommaSeparatedList"/>
               <xsd:choice>
                  <xsd:element name="filter" type="xsd:string"/>
                  <xsd:element name="bbox" type="wfs-kvp:BBoxType"/>
               </xsd:choice>
            </xsd:sequence>
         </xsd:choice>
      </xsd:sequence>
   </xsd:complexType>
   <!-- TRANSACTION TYPE DEFINITION ======================================= -->
   <xsd:complexType name="TransactionRequestType">
      <xsd:annotation>
         <xsd:documentation>
            JL: avoids Unique Particle Attribution constraint violation.
         </xsd:documentation>
      </xsd:annotation>
      <xsd:sequence>
         <xsd:element name="service" type="xsd:string" 
                      minOccurs="1" maxOccurs="1" fixed="WFS"/>
         <xsd:element name="version" type="xsd:string" minOccurs="0"/>
         <xsd:element name="request">
            <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                  <xsd:enumeration value="Transaction"/>
               </xsd:restriction>
            </xsd:simpleType>
         </xsd:element>
         <xsd:element name="operation">
            <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                  <xsd:enumeration value="delete"/>
               </xsd:restriction>
            </xsd:simpleType>
         </xsd:element>
         <xsd:element name="releaseaction" type="wfs-kvp:All_Some_ValueType"
            minOccurs="0"/>
         <xsd:choice>
            <xsd:element name="featureid" type="wfs-kvp:CommaSeparatedList"/>
            <xsd:sequence>
               <xsd:element name="typename" type="wfs-kvp:CommaSeparatedList"/>
               <xsd:choice>
                  <xsd:element name="filter" type="xsd:string"/>
                  <xsd:element name="bbox" type="wfs-kvp:BBoxType"/>
               </xsd:choice>
            </xsd:sequence>
         </xsd:choice>
      </xsd:sequence>
   </xsd:complexType>

   <xsd:element name="GetCapabilities"
                type="wfs-kvp:GetCapabilitiesType"/>
   <xsd:element name="DescribeFeatureType"
                type="wfs-kvp:DescribeFeatureTypeRequestType"/>
   <xsd:element name="GetFeature"
                type="wfs-kvp:GetFeatureRequestType"/>
   <xsd:element name="GetGMLObject"
                type="wfs-kvp:GetGMLObjectRequestType"/>
   <xsd:element name="LockFeature"
                type="wfs-kvp:LockFeatureRequestType"/>
   <xsd:element name="Transaction"
                type="wfs-kvp:TransactionRequestType"/>
</xsd:schema>
